package wangwenjun.phase2.concurrencypattern.eventrouter.demo01.framework;

import lombok.extern.slf4j.Slf4j;
import util.ThreadUtil;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author ChangLiang
 * @date 2020/6/20
 */
@Slf4j
class EventValve {

    public static void handleEventA(Event event) {
        ThreadUtil.sleepForMilliSeconds(ThreadLocalRandom.current().nextInt(200,1000));
        log.info("handle event 01--result:{}", event.getData().toLowerCase());
    }

    public static void handleEventB(Event event) {
        ThreadUtil.sleepForMilliSeconds(ThreadLocalRandom.current().nextInt(200,1000));
        log.info("handle event 02--result:{}", event.getData().toUpperCase());
    }
}
